package com.day.newcorp;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface AuthUtil {

	public AuthenticationStatus authenticateRequest(HttpServletRequest request, HttpServletResponse response);
	
	/**
	 * CcpAuthenticationHandler calls this method for every request.
	 * purpose is to create a ccp_portalName cookie or update  it's max age (session management)  
	 * @param request HttpServletRequest
	 * @param response HttpServletResponse  
	 */		
	public abstract void createOrUpdateCCPCookie(HttpServletRequest request , HttpServletResponse response,String validationStatus);
	
	/**
	 * Method to bound mongodb customer object toccp_portalName cookie.  
	 * @param request HttpServletRequest.
	 * @param response HttpServletResponse.  
	 * @return true if operaiton success else false.  
	 */
	public abstract boolean updateCustomerToCookie(HttpServletRequest request , HttpServletResponse response);


	/**
	 * extracts the session id from ccp_portalName cookie
	 * and returns it
	 * @param request HttpServletRequest
	 * @return sessionId String
	 */
	public abstract String getCCPSessionId(HttpServletRequest request);
		
	

	/**
	 * Creates the portal specific cookie with a timeout
	 * setting of 0, which forces the cookie to be deleted
	 * 
	 * @param portalName
	 * @return
	 */
	public abstract void createLogoutCookie(HttpServletRequest request,HttpServletResponse response);
	
	
	
}